repo="$1"

function ajuda {
  echo "Uso: fossil2git.sh repo.fossil"
  exit 1
}

[ -z "$repo" ] && ajuda

mkdir -p "git"
cd "git"
touch "fossil.marks" "git.marks"
fossil export --git \
  --import-marks "fossil.marks" \
  --export-marks "fossil.marks" \
  "../${repo}" | \
git fast-import \
  --export-marks="git.marks" \
  --import-marks="git.marks"
